<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <title>listOrders</title>
    <link rel="StyleSheet" href="/css/mypetstore.css" type="text/css" media="screen"/>
</head>
<body>
<header th:replace="~{common/top}"></header>
<h2>My Orders</h2>

<table   width="100%"   height="100%" border="0"   cellspacing="0"   cellpadding="0">
    <tr>
        <td   align="center"   valign="middle">
            <table style="background-color:lightskyblue; margin:auto">
                <tr>
                    <th>Order ID</th>
                    <th>Date</th>
                    <th>Total Price</th>
                </tr>
                <tr th:each="order : ${orderList}">
                    <td>
                        <a th:href="@{'/order/viewOrder?orderId=' + ${order.orderId}}" th:text="${order.orderId}">Order ID</a>
                    </td>
                    <td>
                        <span th:text="${#dates.format(order.orderDate, 'yyyy-MM-dd')}">Order Date</span>
                    </td>
                    <td>
                        <span th:text="${#numbers.formatDecimal(order.totalPrice, 2, 'currency')}">Total Price</span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

<div th:replace="~{common/bottom}">

</div>
</body>
</html>
